clear

log using analysis_other.log 

use "subsidy_leader_full.dta",clear 
count //29100 


*Table A.1 - Number of firms and ownership types
label values year year
gen firm_type2=firm_type
replace firm_type2="Other" if firm_type=="Collective enterprises"|firm_type=="Other enterprises"|firm_type=="Public enterprises"|firm_type=="Foreign enterprises"|firm_type==""

tabout year firm_type2 using TableA1.tex, style(tex) format(0) replace


*Figure A.3 - Distribution of publicly listed companies across 31 provinces
clear 
use firm_count_map.dta

spmap firm_count using Provinces_1997_shp, id(_ID) fcolor(Blues) ///
clmethod(custom) clbreaks(0 1 29 43.5 96 575) ///
legend(symy(*1.2) symx(*1.2) size(*1.2) position(9) bmargin(top)) legorder(lohi)  

graph export FigureA3.png, replace 


*Table A.12 - Effect of political connections on private firm subsidies
clear
use "firm_polcon.dta", replace
tab private, m
su polcon_ratio 

count // 1374  
xtset firmID year  
*set up fe
egen industry_name_CSRC_f=group(industry_name_CSRC)
egen industry_year=group(industry_name_CSRC year)
encode current_gvn, gen(current_gvn_f)

*Table A.12 - Political connections and private firm subsidies
reghdfe subsidy_assets_w L.polcon_ratio if private==1, absorb(year provid industry_name_CSRC_f) vce(cluster provid)
est sto polcon_lag1_subass1
reghdfe subsidy_assets_w L.polcon_ratio L.log_revenue_w if private==1, absorb(year provid industry_name_CSRC_f) vce(cluster provid)
est sto polcon_lag1_subass2
reghdfe subsidy_assets_w L.polcon_ratio L.log_assets_w if private==1, absorb(year provid industry_name_CSRC_f) vce(cluster provid)
est sto polcon_lag1_subass3
reghdfe subsidy_assets_w L.polcon_ratio L.log_assets_w L.ROA_w if private==1, absorb(provid industry_year) vce(cluster provid)
est sto polcon_lag1_subass4
reghdfe subsidy_assets_w L.polcon_ratio L.log_assets_w L.ROA_w if private==1, absorb(current_gvn_f industry_year) vce(cluster provid)
est sto polcon_lag1_subass5

outreg2 [polcon_lag1_subass1 polcon_lag1_subass2 polcon_lag1_subass3 polcon_lag1_subass4 polcon_lag1_subass5] using TableA12.tex, replace label dec(3)

log close
